import { ref } from 'vue';

export default function useLoading(state = false) {
    const loading = ref(state);
    const setting = (value: boolean) => {
        loading.value = value;
    };
    const toggles = () => {
        loading.value = !loading.value;
    };
    return {
        loading,
        setting,
        toggles
    };
}